// pages/car/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        isAuth: false
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {

    },
    // 点击获取收获地址
    handleAddress() {
        wx.getSetting({
            success: (result) => {
                // 获取权限状态
                const scopeAddress = result.authSetting["scope.address"];
                if (scopeAddress === true || scopeAddress === undefined) {
                    wx.chooseAddress({
                        success: (result1) => {
                            console.log(result1)
                        },
                        fail: (err) => {
                            console.log(err);
                            this.setData({
                                isAuth: true
                            })
                        }
                    });
                }
            }
        })
    },
    handleAddressAgain() {
        wx.openSetting({
            success: (result1) => {
                wx.chooseAddress({
                    success: (result2) => {
                        console.log(result2)
                    }
                });
            }
        })

    }
})